package com.quyunshuo.module.home.room.entity

import androidx.room.Entity
import androidx.room.PrimaryKey
import androidx.room.TypeConverters
import com.quyunshuo.module.home.room.Converters
import com.quyunshuo.module.home.room.TagListConverter
import java.util.Date

@Entity(tableName = "music")
@TypeConverters(Converters::class, TagListConverter::class) // 添加这行
data class MusicEntity(
    @PrimaryKey(autoGenerate = false)
    val id: Long = 0,
    val title: String = "我的",
    val artist: String = "",
    val album: String = "",
    val duration: Long = 100, // 毫秒
    val path: String = "",
    val albumId: Long = 1,

    // 新增字段用于最近播放功能
    val lastPlayed: Long = 0, // 最后播放时间戳
    val playCount: Int = 0,    // 播放次数
    val createdAt: Long =  System.currentTimeMillis(),
)